/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frtimer.h                                          */
/*  NOTE      = 时钟管理                                           */
/*  DATE      = 2014/11/29 yaohl                                   */
/*******************************************************************/

#ifndef __FRTIMER_H_
#define __FRTIMER_H_

#include <event2/event.h>
#include <event2/event_struct.h>


typedef struct __st_timer_entry {
    //Frtimer_cmd em_cmd_type;

    //event_callback_fn cb;
    //void *arg;

    struct event  *p_st_event;
    struct timeval st_delay;

    //void *p_userdata;
} Timer_entry;

int frtimer_init(void);

struct event *frtimer_new(struct event_base *base, event_callback_fn cb, void *arg, const struct timeval *tv);
int frtimer_add(struct event *ev, const struct timeval *tv);
int frtimer_del(struct event *ev);
int frtimer_reload(struct event *ev, const struct timeval *tv);
int frtimer_free(struct event *ev);

void frtimer_destory(void);

#endif
